#ifndef _MYDB_H
#define _MYDB_H
  
#include <string>
#include <iostream>
#include <mysql/mysql.h>
#include <jsoncpp/json/json.h>

using namespace std;
    
class MyDB
{ 
	      
public:
	MyDB();
	~MyDB();
	bool InitDB(string host,string user,string pwd,string dbname);
    int rowCount(string sql);
	int ExeSQL(string sql);
        /*******************************************
         *
         * *******************************************/
	bool resultSQL(string sql,Json::Value &resultArray);
private:
	MYSQL* mysql;
	MYSQL_ROW row;
	MYSQL_RES* result;
	MYSQL_FIELD* field;
};
    
    
#endif             

